<?php
/**
 * Created by PhpStorm.
 * User: lcz
 * Date: 2018/4/11
 * Time: 15:58
 * 商品
 */
namespace app\mobile\controller;

use app\common\controller\Mobile;
use app\common\library\Auth;
use think\Db;

class Goods extends Mobile {
	/**
	 * 商品详情
	 */
	public function detail(){
		$id = input('id');
		return $this->fetch('detail', [
			'title' => '商品详情',
			'id' => $id,
		]);
	}
	
	
	/**
	 * 商品详情
	 */
	public function searchGoods(){
		return $this->fetch('searchGoods', [
			'title' => '搜索结果',
			'keyword' => input('keyword')
		]);
	}
	
	
	/**
	 * app商品详情
	 */
	public function appDetail(){
		$id = input('id');
		if(!$id){
			$this->error('参数错误');
		}
		$goods = Db::name('goods')->find($id);
		return $this->fetch('appDetail', [
			'title' => '商品详情',
			'goods' => $goods,
		]);
	}
	
	/**
	 * 秒杀商品
	 */
	public function spike(){
		return $this->fetch('spike', [
			'title' => '限时抢购',
		]);
	}
	
	/**
	 * 拼团商品
	 */
	public function group(){
		return $this->fetch('group', [
			'title' => '团购商品',
		]);
	}
}